<template>
  <div>
    <div p-32rpx>
      <!-- 没有默认地址 -->
      <div @click="$navigateTo(`/pages/mine/order/user-address?way=${props.way}`)" v-if="!props.address.id" flex flex-a-c flex-j-sb>
        <div>请选择配送地址</div>
        <div><nut-icon size="12" name="rect-right"></nut-icon></div>
      </div>
      <!-- 有默认地址 -->
      <div @click="$navigateTo(`/pages/mine/order/user-address?way=${props.way}`)" v-if="props.address" flex flex-a-c flex-j-sb>
        <div>
          <div> <nut-tag v-if="props.address.isDefault" :custom-color="colors.themeColor">默认</nut-tag>
            {{ props.address.consigneeAddressPath.join('') }}</div>
          <div font-bold text-40rpx my-20rpx>{{ props.address.detail }}</div>
          <div> {{ props.address.name }} {{ props.address.mobile }}</div>
        </div>
        <div>
          <nut-icon name="rect-right"></nut-icon>
        </div>
      </div>
    </div>
    <div class="bar"></div>

  </div>
</template>

<script setup lang="ts">
import { colors } from '@/constants/injection-key';
const props = defineProps<{
  way: any,
  address: any,
}>()
</script>

<style scoped>
.bar {
  height: 4rpx;
  overflow: hidden;
  width: 100%;
  background: url('/static/line.png');
  background-repeat: no-repeat;
}
</style>
